import request from '@/utils/request'

export function sentData(data) {
  return request({
    url: '/lentBook',
    method: 'post',
    data
  })
}

export function getDate(data) {
  return request({
    url: '/backBook',
    method: 'post',
    data
  })
}

export function login(data) {
  return request({
    // url: '/vue-element-reader/user/login',
    url: '/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    // url: '/vue-element-reader/user/info',
    url: '/info',
    method: 'get',
    params: { token }
  })
}

export function getUserDetial(token) {
  return request({
    url: '/readerInfo',
    method: 'post',
    token
  })
}

export function logout() {
  return request({
    // url: '/vue-element-reader/user/logout',
    url: '/logout',
    method: 'post'
  })
}

export function reading() {
  return request({
    url: '/noBack',
    method: 'get'
  })
}

export function history() {
  return request({
    url: '/isBack',
    method: 'get'
  })
}

export function getReader() {
  return request({
    url: '/getReader',
    method: 'get'
  })
}
